// 一个用户信息
interface userInfoItem {
    type: string
    approverId: number
    name: string
}

// 用户集合
interface userSet {
    approveUserType: string
    approverList?: userInfoItem[]
    userInfoMap?: any
    idList?: number[]
    departmentIdList?: number[]
    userGroupIdList?: number[]
}

// 审批人信息
interface approveUserInfo extends userSet {
    approveType: string
}

// 负责人信息
interface responsiblePerson extends userSet {
    responsiblePersonMap: any
}

// 抄送人配置信息
interface ccConfig extends userSet {
    isEnable?: boolean
}

// 自动审批配置
interface automaticApprovalConfig {
    initiatorAutomaticApprovalFlag: boolean
    adjacentNodeAutomaticApprovalFlag: boolean
}

// 基础权限表单
interface basePermission {
    processRollbackFlag: boolean
    processRejectFlag: boolean
    submitFlag: boolean
    saveFlag: boolean
    formEditPermissionFlag: boolean
    rollbackNodeRange: string
}

// 关联报表表单
interface reportPermission {
    associatedReportFlag: boolean
    reportConfig: string
    defaultDisplayContent: string
}

// 一个表单字段权限的表单
interface formFieldPermissionItem {
    fieldId: string
    visibilityFlag: boolean
    editableFlag: boolean
    [key: string]: any
}

// 一个审批按钮配置的表单
interface buttonSettingItem {
    name: string
    showName: string
    batchApprovalFlag: boolean
    enable: boolean
}
// 审批按钮配置的表单数据
export interface approveButtonConfig {
    buttonSetting: buttonSettingItem[]
}

// 权限配置的表单数据
export interface permissionForm {
    basePermission: basePermission
    reportPermission: reportPermission
    pageFieldIdList: formFieldPermissionItem[]
}

export interface conditionItem {
    id: number
    name: string
    active: boolean
    [key: string]: any
}

export interface taskNodeAttributeForm {
    processNodeName: string
    nodeTaskType: string
    approveUser: approveUserInfo
    cc: ccConfig
    automaticApprovalConfig: automaticApprovalConfig
    unapprovedUserProcessMethod: string
    responsiblePerson: responsiblePerson
    rollbackNodeFlag: true,
    condition: {
        rule: conditionItem[]
    }
}

// 流程节点对应的表单数据
export interface processNodeForm {
    processNodeId: string
    processNodeName: string
    processNodeType: string
    nodeTaskType: string
    approveButtonConfig: approveButtonConfig
    basePermission: basePermission
    reportPermission: reportPermission
    pageFieldIdList: formFieldPermissionItem[]
    approveUser: approveUserInfo
    cc: ccConfig
    automaticApprovalConfig: automaticApprovalConfig
    unapprovedUserProcessMethod: string
    responsiblePerson: responsiblePerson
    rollbackNodeFlag: true
    // TODO 表单其他部分的定义后续完善
    [key: string]: any
}
